package c.e.a.b.b;

import android.os.Parcel;
import android.os.RemoteException;
import android.util.Log;
import b.i.b.f;
import c.e.a.b.c.a;
import c.e.a.b.e.b.b;
import c.e.a.b.e.b.c;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;

public abstract class p extends b implements c.e.a.b.b.h.p {
    public static final /* synthetic */ int b = 0;
    public int a;

    public p(byte[] bArr) {
        super("com.google.android.gms.common.internal.ICertData");
        f.J(bArr.length == 25);
        this.a = Arrays.hashCode(bArr);
    }

    public static byte[] K0(String str) {
        try {
            return str.getBytes("ISO-8859-1");
        } catch (UnsupportedEncodingException e) {
            throw new AssertionError(e);
        }
    }

    public abstract byte[] J0();

    public boolean equals(Object obj) {
        if (obj != null && (obj instanceof c.e.a.b.b.h.p)) {
            try {
                c.e.a.b.b.h.p pVar = (c.e.a.b.b.h.p) obj;
                if (pVar.s() != this.a) {
                    return false;
                }
                a r = pVar.r();
                if (r == null) {
                    return false;
                }
                return Arrays.equals(J0(), (byte[]) c.e.a.b.c.b.K0(r));
            } catch (RemoteException e) {
                Log.e("GoogleCertificates", "Failed to get Google certificates from remote", e);
            }
        }
        return false;
    }

    public int hashCode() {
        return this.a;
    }

    public final a r() {
        return new c.e.a.b.c.b(J0());
    }

    public final int s() {
        return this.a;
    }

    public final boolean y0(int i, Parcel parcel, Parcel parcel2, int i2) {
        if (i == 1) {
            a r = r();
            parcel2.writeNoException();
            c.b(parcel2, r);
            return true;
        } else if (i != 2) {
            return false;
        } else {
            i = this.a;
            parcel2.writeNoException();
            parcel2.writeInt(i);
            return true;
        }
    }
}
